Add Python-bindings for parsing module#7
Conversation
adwait
commented
Oct 13, 2025
- use PyO3 package in rust
- expose the Expr class as a python dictionary
- expose the parse function (with indexing using a Python int ExprRef)
- use PyO3 package in rust - expose the Expr class as a python dictionary - expose the parse function (with indexing using a Python int ExprRef) Signed-off-by: adwait <adwait@berkeley.edu>
|
This is neat! I like how short and simple everything is. I do need to think a bit more about what to do with the |
|
Should be a fairly small/easy fix if we decide to refactor to a global Context, i.g.? Is multi-threading a concern? |
Currently your binding has a combination of a context and a TransitionSystem, but I am not sure how far you can get with that. The alternative would be to allow users to specify a Context for every function call that needs one, but provide a default global Context that everything can use. That is how I imagine the z3 Python bindings work. In terms of API, 90% of functionality is probably going to be similar to z3 and pySMT, so borrowing the API of one or the other might make sense instead of coming up with our own custom representation. Here are some use cases I would like to see to make sure the Python API works in these situations before merging it:
That might be a bit too ambitious though. Do you know which use case would be the most relevant for you at this moment? |
241d3c1 to
1438b3a
Compare
1438b3a to
6175217
Compare